Simultaneous interface use

ABSTRACT

In a portable data carrier ( 1 ) having a contact-type interface device ( 2, 3 ) and a contactless interface device ( 4, 5 ) a sequencing device ( 6 ) coordinates competingly occurring contact-type and contactless data communications ( 16, 19 ) in such a way that the two data communications ( 16, 19 ) can be carried out sequentially step-by-step and without data loss. The processing of the first data communication via the first interface ( 4 ) is interrupted in order to start a second data communication via the second interface ( 2 ). After the step of starting, the interrupted processing of the first data communication is continued while at the same time the started second data communication is maintained.

The present invention relates to a method for the simultaneous operationof two interfaces of a portable data carrier as well as such a datacarrier, in particular a chip card, a secure multimedia card, a mobileradio card or the like.

Present developments in the field of portable data carriers, such ase.g. chip cards and the like, for more flexible applicationpossibilities use a plurality of physically independent interfaces. Inparticular, portable data carriers can be provided with a conventionalcontact-type interface as well as an additional contactless interface,e.g. an antenna device for a radio link. The actual data communicationthen is carried out with the help of respective contact-typecommunications protocols (in the field of chip cards and mobile radiocommunications e.g. T=0, T=1) and/or contactless communicationsprotocols (e.g. T=CL) with an external communication unit, with whichthe data carrier is in a communication connection.

Both, the operating systems and control systems available for portabledata carriers having a contact-type and a contactless interface and thedata communication modes presently supported by the multiple read/writeunits and communication units, however, exclusively admit only one datacommunication at a time either via the contact-type or via thecontactless interface. But this is disadvantageous in situations, inwhich during a data communication via one of the two interfaces, via theother interface there starts a further data communication, which is notrepeatable at a later point in time. Such a scenario is given with aportable data carrier formed as a mobile radio card, for example, whenvia the contact-type interface there is made a mobile phone call andmeanwhile via the contactless interface a payment transaction, e.g. inpublic transport, is to be handled. For other types of portable datacarriers other scenarios are thinkable respectively.

An obvious solution of this problem is to install a real-timemultitasking operating system on the portable data carrier, in order torealize a simultaneous data communication via the two interfaces asconcurrent, virtually parallel processes. At present, however, thissolution is not realistic in view of the limited resources of portabledata carriers and in many cases also not required for the normal use ofsuch data carriers.

U.S. Pat. No. 6,105,874 discloses a portable data carrier with acontact-type and a contactless interface, which switches between the twointerfaces with the help of an OR logic. But when the two interfaces areactive at the same time the OR operation leads to data losses. U.S. Pat.No. 6,045,043 discloses a double interface apparatus, with which acontactless data communication is started, as soon as a magnetic fieldis present at the contactless interface, independent of the respectivestate of the contact-type interface. Such preferential treatment of thecontactless interface, however, leads to disadvantages with respect tothe stability of contact-type data communications.

Therefore, it is an object of the present invention, that a contact-typeand a contactless interface of a portable data carrier can besimultaneously and reliably operated.

This problem is solved according to the invention by a method and anapparatus having the features of the independent claims. The dependentclaims describe advantageous embodiments and developments of theinvention.

In the following one starts out from the situation that with a portabledata carrier, which is provided with a first interface device comprisinga first interface and a second interface device comprising a secondinterface as well as with a processor, and that the first interfacedevice carries out a data communication via the first interface,meanwhile a data communication is started via the second interface bythe second interface device. Then a sequencing device of the datacarrier sequences the competing data communications by interrupting thefirst data communication and starting the second data communication orby delaying the start of the second data communication. In this way thesecond data communication which starts during the first datacommunication can be processed virtually simultaneous to the first,without there occurring a data conflict or that one of the two datacommunications remains entirely disregarded because of a preferredtreatment of the respective other data communication.

The sequencing device coordinates the operation of the interface devicesand that of the pertinent interfaces respectively in such a way that asequential processing of simultaneous data communications is permitted.For this purpose the sequencing device sends a respective signal to thefirst interface device in order to signal to it that the first datacommunication carried out at that moment is to be interrupted, and afurther signal to the second interface device in order to signal thatthe second data communication is to be started. Alternatively, thesequencing device sends a signal to the second interface device in orderto signal that the second data communication is to be delayed, while thefirst interface device can continue the first data communication in anuninfluenced fashion.

In case the first interface device is a contactless interface devicewith a contactless interface and the second interface device is acontact-type interface device with a contact-type interface, thereresults the situation, that during a running contactless datacommunication via the contactless interface a contact-type datacommunication via the contact-type interface is added. In this case in afirst embodiment of the invention, after the running contactless datacommunication has been interrupted, the contact-type data communicationis started and entirely completed) and subsequently the interruptedcontactless data communication is continued. This is coordinated by thesequencing device sending respective signals to the contactless and thecontact-type interface device. Here within the framework of thecontact-type data communication an incoming block of messages or data iscompletely received by the contact-type interface device and stored in aFIFO (first in-first out) or other memory of the data carrier. Thisstorage operation can be realized, for example, by a direct memoryaccess (DMA) or in an interrupt-driven fashion. Such a block of messagesor data to be completely stored in particular can be an instruction,which is sent by an external communication unit being in contact withthe data carrier via the contact-type interface, e.g. by a command APDU(C-APDU; Application Protocol Data Unit) when using the T=1communications protocol.

Within the framework of the contact-type data communication, in responseto the incoming instruction, e.g. of a command APDU, a response, e.g. arespective response APDU (R-APDU) caused by the sequencing device, issent via the contact-type interface to the external communication unit.For this within the framework of the T=1 protocol a given response time(BWT; Block Waiting Time) between the incoming instruction and thesending of the respective response is provided, the data communicationbeing aborted by the external communication unit when it does notreceive any incoming response within the response time BWT. To avoidsuch a consequence after the end of the response time BWT, thesequencing device can give instructions to the contact-type interfacedevice with the help of a respective signal as to direct an extensioninquiry (WTX; Waiting Time Extension) to the external communication unitwaiting, in order to extend the processing time for generating andsending the response required by the contact-type interface device.

In a second embodiment of the present invention the start of thecontact-type data communication is delayed until the already runningcontactless data communication is entirely completed. The delay of thestart of the contact-type data communication is caused by the sequencingdevice with the help of a respective signal to the contact-typeinterface device. Thereupon, the contact-type interface device delaysthe contact-type data communication by ignoring a data input at thecontact-type interface, by incoming data not being further processed. Byignoring/not processing the data incoming at the contact-type interface,however, an asynchronous input buffer (UART; Universal AsynchronousReceiver Transmitter) disposed immediately downstream of thecontact-type interface can overflow, since the incoming data exceed the(normally low) storage capacity of the UART buffer storage.

This, however, is recognized after the completion of the contactlessdata communication by the sequencing device with the help of the stateof the UART storage, so that a contact-type data communication startedwhile the contactless data communication was carried out can besubsequently recognized. On the basis of the incorrect contact-type datacommunication determined in this way, the contact-type interface deviceis given instructions by a respective signal of the sequencing device asto send an error message to the external communication unit, so that itrepeats the contact-type data communication. Then the contact-type datacommunication can be completely and undisturbed received by thecontact-type interface device.

The two above-mentioned embodiments are particularly suitable for chipcards and the like, the contact-type interface device of which worksaccording to the block-based T=1 communications protocol. In contrast tothis, the following third embodiment can preferably be used within theframework of the T=0 communications protocol by the contact-typeinterface device of a chip card. In the third embodiment the contactlessdata communication is interrupted when the contact-type datacommunication is started, and only the header of an instruction (C-APDU)received within the framework of the contact-type data communication isreceived, which must not be lost in a contact-type data communicationwithin the framework of the T=0 protocol. In an incoming instruction inthe form of a command APDU the header in the T=0 protocol consists offive bytes, which, caused by the sequencing device, are temporarilystored in a FIFO buffer (first-in first-out) or any other memory ormemory area of the data carrier in particular by a direct memory access(DMA) or in an interrupt-driven fashion.

After the receipt of the header the sequencing device again switchesover to the temporarily deactivated contactless interface device, inorder to continue the interrupted contactless data communication. Afterthe completion of the continued contactless data communication, thecontact-type data communication is continued by the contact-typeinterface device and finally completed. When interrupting thecontact-type data communication after the receipt of the header, apredetermined interruption time (WWT, Work Waiting Time), whichindicates the maximum duration of an interruption of the contact-typedata communication, has to be observed. If the contactless datacommunication cannot be continued within this interruption time WWT, theinterruption time WWT will be extended until the contactless datacommunication can be completed and the interrupted contact-type datacommunication can be continued. Interrupting, switching and continuingthe data communications is coordinated by the sequencing device, whichalso monitors and, if necessary, extends the predetermined interruptiontime WWT of the contact-type data communication.

While the three above-described embodiments are applicable, when acontact-type data communication starts during a running contactless datacommunication, in the following there are described two furtherembodiments for the opposite case, namely that a contactless datacommunication starts during a running contact-type data communication.In principle, the two following embodiments can be combined in anydesired way with the three above-described embodiments.

In the fourth embodiment the running contact-type data communication isinterrupted by a waiting phase caused by the sequencing device, duringwhich the sequencing device activates the contactless interface device.During this waiting phase, which preferably is arranged directly afterthe receipt of an instruction (e.g. a C-APDU) by the contact-typeinterface device and before the sending of a respective response (e.g. aR-APDU), the contactless interface device is ready-to-receive. If duringthe waiting phase a contactless data communication is not started, thecontact-type interface device will be re-activated, which then cancontinue the contact-type data communication interrupted before. If,however, during the waiting phase a contactless data communicationstarts, such communication is completed by the contactless interfacedevice, even when this exceeds the originally arranged waiting phase. Inthis case, the waiting phase is extended, caused by the sequencingdevice, until the contactless data communication is entirely completed.

The waiting phase is realized by the contact-type interface device as aproactive phase) i.e. with the help of proactive commands, which reversethe master-slave relation between the external communication unit andthe data carrier compulsory with the T=0 and T=1 protocol, so that aninstruction can be given by the data carrier, which is answered by theexternal communication unit. With the help of such proactive commands ofthe data carrier, from the external communication unit there can berequested, in principle, waiting-phases of any length to be used forother purposes during a contact-type data communication. This ispossible in particular with the help of the FETCH command and theTERMINAL RESPONSE command, with the help of which an externalcommunication unit can be caused to first fetch an instruction (e.g. therequest for the waiting phase) at the data carrier and subsequently senda response to the instruction to the data carrier. With the help of suchproactive commands in the case of a starting contactless datacommunication the waiting phase can be extended, caused by thesequencing device, until the contactless data communication is entirelycompleted. Since the mechanism of the proactive commands is providedwithin both the framework of the T=0 and of the T=1 protocol, thisfourth embodiment can be realized with the two protocols.

With a fifth embodiment of the present invention the contactlessinterface is locked/deactivated by the sequencing device until thealready running contact-type data communication via the contact-typeinterface device is completed, i.e. an instruction (C-APDU) was receivedand a respective response (R-APDU) was sent. Here there is made use ofthe fact, that an external radio communication unit, which wants toestablish a contactless data communication with the data carrier via thecontactless interface device of the data carrier, recognizes by repeatedpolling when the contactless interface is unlocked/activated, in orderto then start the contactless data communication. This embodiment ispreferably used with the T=0 protocol, but can also be implemented inthe T=1 protocol.

Further features and advantages of the invention appear from thefollowing description of various embodiments and alternative embodimentsaccording to the invention in connection with the accompanying Figures.

FIG. 1 shows a schematic representation of a chip card having acontact-type and a contactless interface;

FIG. 2 shows a flow chart of a sequencing process in the T=0 protocol;

FIG. 3 shows a flow chart of a first variant of a sequencing process inthe T=1 protocol;

FIG. 4 shows a flow chart of a second variant of a sequencing process inthe T=1 protocol; and

FIG. 5 shows a flow chart of an alternative sequencing process.

FIG. 1 schematically shows a portable data carrier having the form of achip card 1 with a processor 7 (CPU) and a three-stage memory arrayconsisting of a permanent ROM memory 8, in which is located theoperating system of the chip card 1, a rewritable EEPROM memory 9 and avolatile RAM main memory 10. In addition, chip card 1 comprises acontact-type interface device 2, 3, which comprises a conventionalsix-field or eight-field contact surface according to ISO 7816 as aphysical interface 2 and a respective interface control 3. Moreover,chip card 1 comprises a contactless interface device 4, 5 with acontactless interface 4, which can be formed as an antenna or the like,and a respective interface control 5.

The contactless data and energy transmission to/from the chip card 1 canbe realized in manifold ways, in particular as a conventional radio orRFID connection. The respective interface controls 3, 5 control theoperation of the pertinent interfaces 2, 4 according to givenstandardized communication protocols. The contact-type interface 2 canbe operated, for example, according to the communications protocols T=0or T=1 usual in chip card and mobile radio communications, while thecontactless interface 4, for example, is operated according to the T=CLprotocol. The two interface controls 3, 5 in principle workindependently of each other and process only the one data communication16, 19, which is handled via the respective interface 2, 4.

In case of simultaneous data communications 16, 19 at two interfaces 2,4 a coordinating sequencing is effected by a sequencing device 6, whichis located downstream of the two interface devices 2, 3 and 4, 5.Sequencing device 6 sequences the handlings of the two competing datacommunications 16, 19, which in principle ought to be carried out inparallel by the respective interface devices 2, 3 and 4, 5, in such away that at any time processor 7 processes only one of the two datacommunications 16, 19 and despite of this a data loss does not happen.For sequencing there is required a communication, coordinated by thesequencing device 6, with the respective external (radio) communicationunits 12, 13, which are in the simultaneous data communications 16, 19with chip card 1. Both interface controls 3, 5 of interfaces 2, 4 andsequencing device 6 can be designed as hardware elements of chip card 1or as software components, which either are stored as applications inEEPROM memory 9 or as components of the operating system in ROM memory8. If they are executed by processor 7 of chip card 1, respectiveprocesses will be formed and processed.

Chip card 1 in principle can be any chip card provided with a processor,for example a smart card, a secure multimedia card or a mobile radiocard, such as e.g. a GSM mobile radio card. In the last-mentioned casethe GSM mobile radio card communicates via the contact-type interface 2with a telecommunication terminal/mobile phone, in which the GSM mobileradio card is inserted, while via the contactless interface 4 there canbe carried out a contactless data communication with an external radiocommunication unit, for example a vending terminal or the like equippedappropriately. In case of a contact-type communication 16 communicationdata 17, 18 are exchanged between the contact-type interface 2 of chipcard 1 and a respective contact-type interface 14 of an externalcommunication unit 12. Likewise, in case of a contactless datacommunication 19 communication data are exchanged between contactlessinterface 4 and a respective contactless interface 15 of a radiocommunication unit 13.

When using the T=0 or T=1 protocol, contact-type data communication 16of the chip card 1 is carried out in the master-slave operation modewith the external communication unit 14, e.g. a mobile phone, as anactive communication partner (master) and the chip card 1 as reactivecommunication partner (slave), which merely reacts to the instructionsof the external communication unit 14. For this reason, in the followingit can be assumed, that a contact-type data communication 16 comprisesan instruction 17 of external communication unit 14 to chip card 1 and asubsequent response 18 of chip card 1 to communication unit 14. In thisconnection instructions and answers, preferably, have anISO-7816-conform structure independent of the protocol. Instruction 17preferably has the form of a command APDU (C-APDU) and response 18 hasthe form of a response APDU (R-APDU). Both, a C-APDU 17 and a R-APDU 18correspond to a standardized data format and comprise both the actualpayload data and supplementary control data. A C-APDU 17 consists ofleading header data 17 a (header) and following payload data 17 b, whilean R-APDU 18 consists of leading payload data 18 a and following trailerdata 18 b (trailer).

Within the scope of the present invention only those technical featuresof chip cards, chip card protocols and data formats are explained, whichare immediately necessary for understanding the invention.

When in the following the terms interrupting or resuming a datacommunication are used, there is meant interrupting or resuming theprocessing of the communication by the SIM card 1 in particular by itsCPU 7. Detailed and supplementary technical connections are described in“Handbook of the chip cards, 4th ed.” by W. Rankl and W. Effing.

FIG. 2 schematically shows the simultaneous processing of a contact-typedata communication 16 (CONTACT COM; FIG. 2, on the left) via thecontact-type interface device 2, 3 sequenced by the sequencing device 6of a SIM mobile radio card 1 as a preferred implementation of a portabledata carrier according to the invention, and a contactless datacommunication 19 (CONTACTLESS COM; FIG. 2, on the right) via thecontactless interface device 4, 5. Here the steps S1 to S10 (FIG. 2, atthe top) constitute the sequencing of a contact-type data communication16, which starts during an already running contactless datacommunication 19, while with the steps S21 to S24 (FIG. 2, at thebottom) a simple sequencing of a contactless data communication 19 isrealized, which starts while a contact-type data communication 16 isalready running.

With a contact-type data communication 16 within the framework of theT=0 protocol the header data 17 a (HEADER) comprising 5 bytes of areceived C-APDU 17 should not be lost. For this reason at least theprocessing of a running contactless data communication (step S1) isinterrupted when a contact-type data communication 16 is started. Theheader data 17 a sent by an external communication unit 12 arecompletely received (step S2) and temporarily stored by the sequencingdevice 6 e.g. in a FIFO memory 11, which preferably is arranged in theRAM memory 10 of SIM card 1. Likewise, header data 17 a can be writteninto a memory or memory area of SIM card 1 provided therefor, e.g. inthe RAM main memory 10, per direct memory access (DMA) or via aninterrupt.

After the header data 17 a have been completely received the sequencingdevice 6 again switches over to the contactless data communication 19,which then is at least carried out further (step S3) or entirelycompleted.

An interruption time WWT (Work Waiting Time) at the contact-typeinterface 2, which indicates the maximum time period between thestarting edges of two received bytes following each other before theabortion of the data reception, is monitored either by the sequencingdevice 6 or the interface control 3. SIM card 1 sends an extensioninquiry 21 (shortly) before the end of the WWT, for example in the formof a so-called zero byte: ‘60’ as a procedure byte, via the contact-typeinterface 2 to the external communication unit 14 (step S4). For thispurpose the contactless data communication 19 continued in step S3, ifrequired, is interrupted again and not continued until after that (stepS5).

There can follow multiple steps of sending extension inquiries (S6)respectively via the contact-type interface 2, in order to maintain thecontact-type data communication 16 until the contactless datacommunication 19 is completed (step S7). In this way, acknowledging thecomplete receipt of the header data 17 a of an incoming C-APDU by theinterface unit 3 with the help of an acknowledge ACK as a procedure byte(step S8) is delayed until after the completion of the contactless datacommunication 19.

Subsequently, the contact-type data communication 16 interrupted onreceipt of the header data 17 a (step S2) is continued according to theprotocol, by in step S9 taking place the exchange of payload data(DATA), i.e. that on the one hand the payload data 17 b of the commandAPDU 17 are transmitted to the SIM card 1 and on the other hand thepayload data 18 a of the response APDU 18 are transmitted to theexternal communication unit 12. Finally, the trailer data 18 b (TRAILER)of the response APDU 18 are transmitted to the external communicationunit 14 (step S14). These trailer data 18 b for example comprise thereturn codices SW1 and SW2 (return code) of the response APDU 18.

When the contactless data communication 19, however, is alreadycompleted with step S3, the interrupted receipt of the instruction 17via the contact-type interface 2 is continued with the steps of sendingS8 the acknowledgement ACK, the data exchange S9 and transmitting S10the trailer data 11 b.

The opposite case that during a contact-type data communication 16 acontactless data communication 19 starts, can be sequenced within theframework of the T=0 protocol.

In a first variant, not separately shown in a Figure, the processing ofthe contact-type data communication 16 at first is interrupted andsubsequently is maintained with the help of extension inquiries 21, inorder to be able to process the contactless data communication 19virtually parallel. The method basically runs analogous to the steps S2to S10 described above in FIG. 1, only step S1 is to be mentallydeleted. After the receipt of header data 17 a as a first procedurestep, the running contact-type data communication 16 is interrupted by anewly started contactless data communication 19. A WWT is monitored forthe contact-type data communication 16 and, if required, extended onceor multiple times by an extension inquiry 21, until the contactless datacommunication 19 is completed. Thereafter, the interrupted contact-typedata communication 16 can be continued.

In a second variant, which is shown in the bottom half of FIG. 2, atfirst there is carried out the contact-type data communication 16 in anoperating state (OPERATING STATE), in which at the same time thecontactless interface 4 is locked by the sequencing device 6, by sendingheader data 17 a of a command APDU 17 (step S21), exchanging payloaddata 17 b, 18 a (step S22) and sending trailer data 18 b of a responseAPDU (step S23). The contactless data communication 19 is blocked ordelayed during the operating state of the contact-type interface device2, 3. This means, that during the operating state of the contact-typeinterface device 2, 3 interrupts, which are produced at the contactlessinterface device 4, 5 by reason of a starting contactless datacommunication 19, e.g. because the contactless interface 4 entries themagnetic field of a radio communication unit 13, are ignored and notprocessed.

Since the radio communication unit 13 carries out a polling for acertain period, when the contactless interface unit 4, 5 is locked, i.e.repeatedly tries to make contact, the start of the contactless datacommunication 19 can be delayed until the completion of the operatingstate. After sending the trailer data 18 b to the external communicationunit 12 the sequencing device 6 converts the contact-type interfacedevice 2, 3 from the operating state into an inoperative state (IDLESTATE), in which at the same time the contactless interface unit 4, 5 isreleased, so that upon the application of a respective magnetic field atthe contactless interface 4 (or with the receipt of an RIQx signal fromthe external radio communication unit 13) the contactless datacommunication 19 can be started and carried out in step S24. After thecompletion of the contactless data communication 19, the operating stateof the contact-type interface device 2, 3 is switched on by thesequencing device 6 and there can take place a further contact-type datacommunication 16.

With the sequencing methods complementing each other that are describedwith respect to FIG. 2 an alternating and lossless processing of thecompeting data communications 16, 19 via interfaces 2, 4 of SIM card 1and with that a simple multitasking for the T=0 protocol is realized.

In a similar way FIGS. 3 and 4 show two alternative sequencing methodsfor a contact-type data communication 16 according to the T=1 protocol,which starts during a contactless data communication 19. The oppositecase of a contactless data communication 19 starting during acontact-type data communication 16 can be realized in the T=1 protocolin principle analogous to the T=0 protocol, i.e. either as shown in thelower half of FIG. 2 or as a method which starts with step 32 of FIG. 3.

Both FIG. 3 and FIG. 4 show the case of a contact-type datacommunication 16 starting during a contactless data communication 19. Inthe T=1 protocol the receipt of header data 17 a and payload data 17 bof an instruction 17 (C-APDU) cannot be interrupted as with the T=0protocol (cf. FIG. 2, above). Therefore, for the T=1 data communication16 two alternatives are expedient, which are realized by steps S31 toS38 (FIG. 3) and S41 to S45 (FIG. 4).

With the embodiment shown in FIG. 3 a contactless data communication 19started in step S31 is interrupted with the start of the contact-typedata communication 16 by the sequencing device 6, so as to first startthe contact-type data communication 16. For this purpose in step S32 theC-APDU 17 is received via contact-type interface 2 and temporarilystored in a FIFO memory 11. Alternatively, data 17 a, 17 b of incominginstruction 17 can also be stored with the help of a direct memoryaccess (DMA) or in an interrupt-driven fashion with priority in anysuitable memory or memory area of SIM card 1. Thereafter, thecontact-type data communication 16 again is interrupted in favor of thecontinuation of the contactless data communication 19 (step S33).

The predetermined response time (BWT, Block Waiting Time) for generatingand sending a response 18 (R-APDU) to the received instruction 17 ismonitored in SIM card 1. In good time before the end of the BWT SIM card1 sends in a step S34 an extension inquiry 21 in the form of a waitingtime extension inquiry (WTX Request) and receives a respectiveacknowledgement (Waiting Time Extension Acknowledge—WTX Ack). Requestingan extension of the waiting period can be effected, if required, severaltimes, until the contactless data communication 19 is completed (stepS35). Requesting S34 the extension can be effected in a fashioncontrolled by CPU 7 of SIM card 1 or by contact-type interface device 2,3. Thereafter, SIM card 1 continues the processing of the contact-typedata communication 16 (step S38). In particular, the steps connectedwith the received command 17 are executed and a respective R-APDU 18 issent via the contact-type interface device 2, 3 to the externalcommunication unit 12.

Moreover, the response time BWT should be adjusted respectively alreadyin the initialization phase (ATR; Answer to reset) of the contact-typedata communication 16 arranged upstream of the described method. The BWTis negotiated between SIM card 1 and external communication unit 12 suchthat it has a value as high as possible.

In the case of a running contact-type data communication 16 and a thenstarting contactless data communication 19, in the T=1 protocol, too,the contact-type data communication 16 can be interrupted and as long asnecessary maintained by respective extension inquiries 21 until thecontactless data communication 19 is completed. This solution can alsobe recognized in FIG. 3, when step S33 is regarded as the start of thecontactless data communication and step S31 is imagined not to be thereor is allocated to the completion of a previous contactless datacommunication.

Before an interruption of the processing of a data communication infavor of the processing of a different data communication it is checked,whether it is permitted at all that the data communication isinterrupted. For example, it can be defined that it is only permittedthat the contact-type data communication is interrupted. Parameter forthe sequencing stored on SIM card 1 can contain information as to whichtype of data communication is permitted to be interrupted. Furthermore,in the parameter to be checked can be differentiated whether it ispermitted that the data communication is interrupted as an initial datacommunication in favor of a second data communication or as a seconddata communication in favor of an initial data communication. Theparameter to be checked can be designed in a card-specific,application-specific and/or command-specific fashion. With that, forexample, the provider of an application has the possibility to adapt thebehavior of the SIM card to his security requirements without a changeof the control software in the SIM card.

Moreover, there can be checked, whether an interruption of a datacommunication is necessary at all. When the remaining runtime expectedfor the processing of a data communication falls below a limit value,the data communication can be continued without an interruption beingnecessary. The remaining runtime can be calculated from a measuredcommand runtime and an expected scheduled runtime for the command. Thelimit value as a parameter for the sequencing can also be designed in acard-specific, application-specific and/or command-specific fashion.

Checking the necessity and/or permissibility of the interruption asdescribed, is an option applicable to all embodiments of the invention.

In an alternative embodiment for the T=1 protocol shown in FIG. 4, arunning contactless data communication 19 (step S41) is not interruptedon the start of a competing contact-type data communication 16, butcompleted.

The competing contact-type data communication 16 here is not activelyinterrupted or completed, but merely not processed. I.e., that the dataof a C-APDU 17 incoming at the contact-type interface 2 in step S42reach into one of the asynchronous UART input buffer 20 arrangeddownstream of the contact-type interface 2, but these data are notread-out further with priority and processed as usual. The consequenceis that the normally relatively small UART buffer 20 overflows alreadyafter a part of the incoming data (step S42) of the C-APDU 17 (OVERFLOW)and at least the remaining data incoming after the overflow are lost(step S43).

After the completion of the contactless data communication 19 thesequencing device 6 recognizes the overflow of the UART buffer 20 andthus that during the processing of the contactless data communication 19a competing contact-type data communication 16 has taken place in stepS23 and S24, which could not be completely received. If necessary, thesequencing device 6 has to let go the still remaining data of the C-APDU17 in step S43 into the void. The end of the transmission of the C-APDU17 is recognized by the sequencing device 6 from the expiring of thecharacter waiting time (CWT), which defines the maximum time periodbetween the starting edges of two consecutive characters within anincoming data block. Then the incorrect receipt of the C-APDU 17 insteps S18 and S19 is acknowledged with an error message (ERR) of thesynchronization device 6 or the contact-type interface device 2, 3 tothe external communication unit 12 in step S44, whereupon the externalcommunication unit 12 again sends C-APDU 17, which then can be receivedproperly and completely (step S45).

Finally, FIG. 5 with steps S51 to S59 shows a further embodiment of asequencing of, in principle, competing data communications 16, 19, forthe case that a contactless data communication 19 starts during analready running contact-type data communication 16. In contrast to theapproaches shown above, the sequencing is not effected solely by the SIMcard, but at least partially in cooperation with the externalcommunication units 12.

For this purpose the running contact-type data communication 16 istemporarily interrupted by the sequencing device 6 at different pointsin time and a ready-to-receive state (STANDBY) of the contactlessinterface 4 is created, in order to be able to recognize and process anystarting contactless data communications 19. For example, after thesending of a C-APDU 17 from the external communication unit 12 to thecontact-type interface device 2, 3 in step S51 and before sending back arespective R-APDU 18 in step S53 a temporary ready-to-receive state ofthe contactless interface device 2, 3 can be arranged (step S52), inorder to be able to process any contactless data communications 19starting during this time period.

In SIM mobile radio cards 1 there is provided a special set of commandswithin the framework of the SIM application toolkit, which providesproactive commands to a mobile radio card 1, which avoid theconventional master-slave relation between a SIM mobile radio card 1 anda communication unit 12, 13 and allow the SIM card 1 to directinstructions to the communication unit 12, which have to be answered bythe latter. For this purpose, in particular the commands STATUS, FETCHand TERMINAL RESPONSE are suitable. With the help of the STATUS commandthe communication unit 12 requests, whether SIM card 1 wants to issueproactive commands. The card will answer with a status code “91XX”, ifit wants to send a command itself. By transmitting the FETCH command,the external communication unit 12 then fetches an instruction at SIMcard 1 which it has to process, while with the help of the TERMINALRESPONSE command (TERM RESP) the respective response of the externalcommunication unit 12 to the instruction fetched before is transferredto SIM card 1. By using the proactive commands of the SIM applicationtoolkit, there can be selectively achieved, e.g. caused by thesynchronization device 6, a ready-to-receive state (STANDBY) at thecontactless interface 4 several times one after the other.

Response 22 in the form of status code “91XX” of SIM card 1 in step S53causes the external communication unit 12 to fetch an instruction at SIMcard 1 with a FETCH command 23 (step S54). SIM card 1 uses theprocessing time granted to it for a ready-to-receive state phase S55 ofthe contactless interface 4.

As an instruction to be fetched by the external communication unit 12now, preferably, the MORE TIME instruction can be used, with which SIMcard 1 requests further time from the external communication unit 12 forthe processing of tasks. In the present case, by the step of sending S56a MORE TIME inquiry 21, it requests the time for a furtherready-to-receive-state phase (STDBY) for processing the contactless datacommunication 19. The MORE TIME instruction 21 of SIM card 1 is grantedby external communication unit 12 with a TERMINAL RESPONSE command (stepS57). If now in the further ready-to-receive-state phase a contactlessdata communication 19 starts (step S58), SIM card 1 can send furtherMORE TIME instructions. Preferably, the ready-to-receive state isextended in such a way until the completion of the contactless datacommunication 19. SIM card 1 can send in step S59, for example, a statuscode “9000” as a response 18 via the contact-type interface device 2, 3to the communication unit 12.

During the proactive phase, before each sending S53, S56, S59 of aresponse, the sequencing device 6 can release/activate the contactlessinterface device 4, 5, in order to be able to recognize and process anycontactless data communication 19. After the sending of the response,the contact-type interface device 2, 3 is re-activated.

With a step S50 of sending a further STATUS command then possibly startsa further data communication 16 between communication unit 12 and SIMcard 1 via contact-type interface device 2, 3.

The time interval between the receipt of two STATUS commands or betweenthe last response of SIM card 1 in a proactive phase and the next STATUScommand should be chosen in a suitable way. Normally, the time intervalis negotiated between SIM card 1 and communication unit 12 in aninitialization phase of the contact-type communication 16. Communicationunit 12 then sends STATUS commands in the agreed time interval. Becauseof the fast reaction time necessary for the contactless datacommunication 19, the time interval should be as small as possible.

From the viewpoint of communication unit 12, however, an as large aspossible time interval would rather be expedient, for example) to saveelectricity or to avoid times in which the communication unit 12 waitsfor an instruction of SIM card 1. Therefore, the time interval should bearranged such that it can be (temporarily) shortened. As a trigger forthe shortening, for example, an input of the user into the communicationunit 12 can be used, with which the user requests a release/activationof the contactless communication interface 4, 5, preferably for alimited time period of for example one minute. But likewise, recognizinga contactless data communication field or recognizing an attempt to setup the contactless data communication can serve as a trigger, thecontactless data communication, preferably, being recognized andcommunicated to communication unit 12 by SIM card 1, for example in theform of a status code of a response 18.

Then the user can activate the contactless interface device 4, 5 for agiven time period, for example one minute, via the SIM applicationtoolkit of the mobile radio card, so that during this time period thesequencing device 6 creates the ready-to-receive state of thecontactless interface device 4, 5 via cycles of proactive commands. Thesequencing device 6 or the contactless interface device 4, 5—optionallyafter an initialization of the contactless interface 4—waits a giventime period (e.g. two seconds) for a contactless data communication 19starting at the contactless interface 4. If within this time period acontactless data communication 19 starts, the sequencing device 6ensures, that such communication can be completed.

Here it is advantageous, that immediately after a contactless datacommunication 19 a user dialogue via the contact-type interface 2 can bestarted. It is also possible that instead of the MORE TIME instructiondifferent proactive commands are used, with which, additionally, acontactless data communication 19 starting at the contactless interface4 is waited for. Instead of the above described proactive operating,there can also be sent one or a plurality of special APDUs from theexternal communication unit 12 to SIM card 1, which for a defined timeperiod wait for a contactless data communication 19 at the contactlessinterface 4. Likewise, it is possible, that the external communicationunit 12, which normally is a mobile radio terminal, operates a cyclicpolling with suitable APDUs, so that the user of the mobile radio card 1does not have to carry out a selection from the menu in the SIMapplication toolkit, in order to activate the contactless interfacedevice 4, 5.

With the above-described embodiments there have to be taken intoconsideration, that the occurrence of a magnetic field at thecontactless interface 4, preferably, doe not necessarily mean that acontactless data communication 19 is really effected. Therefore, it canbe expedient to define the start of a contactless data communication 19as the point in time at which SIM card 1 is selected by the externalradio communication unit 13. Until this point in time, in particular thereceipt and temporary storage of data within the framework of thecontact-type data communication 16 by the contact-type interface device2, 3 and an initialization and anticollision at the contactlessinterface 4 can run in parallel.

Likewise, a contactless data communication 19, which can also consist ofa plurality of APDUs, preferably is “short”, i.e. that in the case oftwo contact-type data communications 16 following each other it can beplaced in between their APDUs. In this connection it can be expedient tomonitor the length of a contactless data communication 19 and tooptionally abort it, if it lasts too long. In case of longer contactlessdata communications 19 it can be expedient to alternately process therespective APDUs of the competing contact-type and contactless datacommunications 16, 19. For this purpose, however, a delay mechanism tobe used at the contactless interface device 4, 5 is necessary. Since theprotocol mechanisms of the contactless T=CL protocol are similar tothose of the contact-type T=1 protocol, also with a contactless datacommunication 19 there can be used a monitoring or extension of theresponse time by WTX inquiries and/or the repeated sending/receiving ofignored and/or lost data blocks.

1. A method in a portable data carrier having a first interface and asecond interface, comprising the following steps: interrupting aprocessing of a first data communication via the first interface;starting a second data communication via the second interface after thestep of interrupting; after the step of starting the processing of thesecond data communication, effecting a continuation of the interruptedprocessing of the first data communication; and maintaining the startedsecond data communication.
 2. The method according to claim 1, whereinthe continued processing of the first data communication is interruptedat least one time by maintaining the second data communication.
 3. Themethod according to claim 1, wherein the step of starting the seconddata communication comprises a receiving of at least a first part ofdata to be received.
 4. The method according to claim 3, wherein thestep of starting the second data communication comprises temporarilystoring at least a first part of the data to be received.
 5. The methodaccording to claim 1, wherein a completion of the maintained second datacommunication is effected after an ending of the first datacommunication.
 6. The method according to claim 5, wherein thecompletion of the maintained second data communication comprises areceiving of a second part of the data to be received.
 7. The methodaccording to claim 5, wherein the completion of the maintained seconddata communication comprises a processing of the data to be received. 8.The method according to claim 3, wherein the received first part is aninstruction.
 9. The method according to claim 3, wherein the receivedfirst part is an instruction header.
 10. The method according to claim1, wherein the second data communication is maintained with the help ofsending an extension inquiry.
 11. The method according to claim 1,including a monitoring of a predetermined waiting period in the firstdata communication and extending the waiting period if the continuedsecond data communication is not completed within the waiting period.12. The method according to claim 1, wherein the first datacommunication is a contact-type data communication and the second datacommunication is a contactless data communication.
 13. The methodaccording to claim 1, wherein the first data communication is acontactless data communication and the second data communication is acontact-type data communication.
 14. The method according to claim 12,wherein the contact-type data communication is carried out according tothe T=0 protocol.
 15. The method according to claim 12, wherein thecontact-type data communication is carried out according to the T=1protocol.
 16. A portable data carrier, comprising a processor, a firstinterface device comprising a first interface and a second interfacedevice comprising second interface; a sequencing device, adapted tosequence a first data communication carried out via the first interfaceand a second data communication starting in the meantime via the secondinterface, said sequencing device arranged to carry out the methodaccording to claim
 1. 17. The portable data carrier according to claim16, wherein the sequencing device is arranged to transmit signals to thefirst interface device to interrupt the first data communication, andsignals to the second interface device to start the second datacommunication.
 18. The data carrier according to claim 16, wherein thefirst interface device is a contactless interface device with acontactless interface for carrying out a contactless data communicationand the second interface device is a contact-type interface device witha contact-type interface carrying out a contactless data communications.19. The data carrier according to claim 16, wherein the portable datacarrier is a chip card, a secure multimedia card or a mobile radio card.